import request from '@/utils/request'
const hftqKey = '038d77d4f1b44dd0a588059f94ecee43'

const yuebaHost = import.meta.env.MODE === 'development' ? '/yueba' : ''

export const jinyangTodayApi = (params) => {
  return request({
    url: yuebaHost + '/jinyang/environment/today',
    method: 'get',
    params
  })
}

export const webWebsiteFlowApi = (params) => {
  return request({
    url: yuebaHost + '/web/api/v1/website/flow/top',
    method: 'get',
    params
  })
}

export const websiteDateStaticsApi = (params) => {
  return request({
    url: yuebaHost + '/website/statistics/dateStatics',
    method: 'get',
    params
  })
}

export const systemDateStaticsApi = (params) => {
  return request({
    url: yuebaHost + '/jinyang/statistics/dateStatics',
    method: 'get',
    params
  })
}

export const webDeviceCountApi = (params) => {
  return request({
    url: yuebaHost + '/web/api/v1/website/device/count',
    method: 'get',
    params
  })
}

export const webDeviceListApi = (params) => {
  return request({
    url: yuebaHost + '/web/api/v1/website/qrcode/list/count',
    method: 'get',
    params
  })
}

export const satisfactionApi = (params) => {
  return request({
    url: yuebaHost + '/web/api/v1/website/satisfaction/count',
    method: 'get',
    params
  })
}

export const jinyangHotelCountApi = (params) => {
  return request({
    url: yuebaHost + '/jinyang/hotel/count',
    method: 'get',
    params
  })
}

export const jinyangTaskCountApi = (params) => {
  return request({
    url: yuebaHost + '/web/api/v1/inspection/task/count',
    method: 'get',
    params
  })
}

export const jinyangQrcodeRegionApi = (params) => {
  return request({
    url: yuebaHost + '/web/api/v1/website/qrcode/list/region',
    method: 'get',
    params
  })
}

export const webApiDeviceListApi = (params) => {
  return request({
    url: yuebaHost + '/web/api/v1/website/device/alllist',
    method: 'get',
    params
  })
}

// 设备告警详情
export const jinyangAlartDetailApi = (id) => {
  return request({
    url: yuebaHost + `/jinyang/alert/${id}`,
    method: 'get'
  })
}

// 应急告警详情
export const jinyangIncidentDetailApi = (id) => {
  return request({
    url: yuebaHost + `/jinyang/incident/${id}`,
    method: 'get'
  })
}

// 告警弹窗点完成接口
export const jinyangAlarmCompleteApi = (id) => {
  return request({
    url: yuebaHost + `/jinyang/alert/complete/${id}`,
    method: 'put'
  })
}

export const weather3dApi = (params) => {
  return request({
    url: yuebaHost + '/jinyang/weather/today',
    method: 'get',
    params: {
      ...params
    }
  })
}
